<!DOCTYPE html>
<html>

<head>
<title>Cindy JS Example</title>
<meta charset="UTF-8">
<script type="text/javascript" src="../build/js/Cindy.js"></script>
<script id="csinit" type="text/x-cindyscript">

x = 0;
f():=(
  x = x + 0.1;
  if (x > 4*pi, x = x - 4*pi; resetclock());
  setTimeout(0.1*(cos(x)+1),f());
);
setTimeout(1, f());

</script>
<script id="csdraw" type="text/x-cindyscript">

draw(5*[sin(x), cos(x)]);
drawtext([-2,6], seconds());
drawtext([-2,7], format(x/(2*pi), 2));

</script>
<script type="text/javascript">

var cdy = CindyJS({
  canvasname: "CSCanvas",
  scripts: "cs*",
  language: "en",
  defaultAppearance: {},
  geometry: [
    {name:"A", type:"Free", pos:[0,0]}
  ]
});

</script>
</head>

<body style="font-family:Arial;">
  <div id="CSCanvas" style="width:500px; height:500px; border:2px solid black"></div>
</body>

</html>
